package com.parent.feign.demo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * fallback:
 * @author yan
 * @date 2023/4/13 0013 15:26
 */
@Component
@Slf4j
public class DeviceFeignClientFallbackFactory implements FallbackFactory<DeviceFeignClient> {
    @Override
    public DeviceFeignClient create(Throwable throwable) {
        log.error("[DeviceFeignClient]服务异常:", throwable);
        return new DeviceFeignClient() {

//            @Override
//            public SerializableResult<DeviceInfoOutVo> deviceInfo(DeviceOutDto deviceOutDto) {
//                return ResultViewUtil.genErrorSerializableResult(DeviceInfoOutVo.class, Constants.ERRCODE_SERVICE_UNAVAILABLE,Constants.ERRMSG_SERVICE_UNAVAILABLE);
//            }
        };
    }
}
